
module VoiceMemory(
  input  wire        clk,
  input  wire        rst_n,
  input  wire [35:0] idata,
  input  wire        wr,
  input  wire [ 5:0] rwaddr,
  input  wire [ 5:0] roaddr,
  output reg  [35:0] odata,
  output reg  [35:0] rodata 
);

reg [35:0] voices_00;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_00 <= #1 36'b000000000000000000000000000000000000;
    else if(wr && (rwaddr==6'd0))
        voices_00 <= #1 idata;
end

reg [35:0] voices_01;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_01 <= #1 36'b000000000000000000000000000000000000;
    else if(wr && (rwaddr==6'd1))
        voices_01 <= #1 idata;
end

reg [35:0] voices_02;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_02 <= #1 36'b011000010001111001111111000000000000;
    else if(wr && (rwaddr==6'd2))
        voices_02 <= #1 idata;
end

reg [35:0] voices_03;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_03 <= #1 36'b011000010000000010000111111100010111;
    else if(wr && (rwaddr==6'd3))
        voices_03 <= #1 idata;
end

reg [35:0] voices_04;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_04 <= #1 36'b000100110001011111101111111100100011;
    else if(wr && (rwaddr==6'd4))
        voices_04 <= #1 idata;
end

reg [35:0] voices_05;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_05 <= #1 36'b010000010000000000001111111100010011;
    else if(wr && (rwaddr==6'd5))
        voices_05 <= #1 idata;
end

reg [35:0] voices_06;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_06 <= #1 36'b001000111001101001001010001111110000;
    else if(wr && (rwaddr==6'd6))
        voices_06 <= #1 idata;
end

reg [35:0] voices_07;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_07 <= #1 36'b000000010000000000001111010000100011;
    else if(wr && (rwaddr==6'd7))
        voices_07 <= #1 idata;
end

reg [35:0] voices_08;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_08 <= #1 36'b000100010000111001111111101001110000;
    else if(wr && (rwaddr==6'd8))
        voices_08 <= #1 idata;
end

reg [35:0] voices_09;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_09 <= #1 36'b011000010000000000000110010000010111;
    else if(wr && (rwaddr==6'd9))
        voices_09 <= #1 idata;
end

reg [35:0] voices_10;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_10 <= #1 36'b001000100001111001101111000000000000;
    else if(wr && (rwaddr==6'd10))
        voices_10 <= #1 idata;
end

reg [35:0] voices_11;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_11 <= #1 36'b001000010000000000000111011000101000;
    else if(wr && (rwaddr==6'd11))
        voices_11 <= #1 idata;
end

reg [35:0] voices_12;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_12 <= #1 36'b001000010001011001011111000000000000;
    else if(wr && (rwaddr==6'd12))
        voices_12 <= #1 idata;
end

reg [35:0] voices_13;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_13 <= #1 36'b001000100000000000000111000100011000;
    else if(wr && (rwaddr==6'd13))
        voices_13 <= #1 idata;
end

reg [35:0] voices_14;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_14 <= #1 36'b001000010001110101111000001000010000;
    else if(wr && (rwaddr==6'd14))
        voices_14 <= #1 idata;
end

reg [35:0] voices_15;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_15 <= #1 36'b011000010000000000001000000000000111;
    else if(wr && (rwaddr==6'd15))
        voices_15 <= #1 idata;
end

reg [35:0] voices_16;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_16 <= #1 36'b001000110010110101101001000000000000;
    else if(wr && (rwaddr==6'd16))
        voices_16 <= #1 idata;
end

reg [35:0] voices_17;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_17 <= #1 36'b001000010000000010001001000000000111;
    else if(wr && (rwaddr==6'd17))
        voices_17 <= #1 idata;
end

reg [35:0] voices_18;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_18 <= #1 36'b001000010001101101100110010000010000;
    else if(wr && (rwaddr==6'd18))
        voices_18 <= #1 idata;
end

reg [35:0] voices_19;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_19 <= #1 36'b001000010000000000000110010100010111;
    else if(wr && (rwaddr==6'd19))
        voices_19 <= #1 idata;
end

reg [35:0] voices_20;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_20 <= #1 36'b001000010000101110101000010101110000;
    else if(wr && (rwaddr==6'd20))
        voices_20 <= #1 idata;
end

reg [35:0] voices_21;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_21 <= #1 36'b001000010000000010001010000000000111;
    else if(wr && (rwaddr==6'd21))
        voices_21 <= #1 idata;
end

reg [35:0] voices_22;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_22 <= #1 36'b001000111000001100001111111100010000;
    else if(wr && (rwaddr==6'd22))
        voices_22 <= #1 idata;
end

reg [35:0] voices_23;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_23 <= #1 36'b000000010000000010001011000000000100;
    else if(wr && (rwaddr==6'd23))
        voices_23 <= #1 idata;
end

reg [35:0] voices_24;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_24 <= #1 36'b100101110010000001111111111100100010;
    else if(wr && (rwaddr==6'd24))
        voices_24 <= #1 idata;
end

reg [35:0] voices_25;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_25 <= #1 36'b110000010000000000001111111100010010;
    else if(wr && (rwaddr==6'd25))
        voices_25 <= #1 idata;
end

reg [35:0] voices_26;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_26 <= #1 36'b011000010000110001011101001001000000;
    else if(wr && (rwaddr==6'd26))
        voices_26 <= #1 idata;
end

reg [35:0] voices_27;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_27 <= #1 36'b000000000000000000001111011001000011;
    else if(wr && (rwaddr==6'd27))
        voices_27 <= #1 idata;
end

reg [35:0] voices_28;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_28 <= #1 36'b000000010101011000111111010000000011;
    else if(wr && (rwaddr==6'd28))
        voices_28 <= #1 idata;
end

reg [35:0] voices_29;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_29 <= #1 36'b000000010000000000001111000000000010;
    else if(wr && (rwaddr==6'd29))
        voices_29 <= #1 idata;
end

reg [35:0] voices_30;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_30 <= #1 36'b001000011000100100111111000111110000;
    else if(wr && (rwaddr==6'd30))
        voices_30 <= #1 idata;
end

reg [35:0] voices_31;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_31 <= #1 36'b010000010000000000001111010000100011;
    else if(wr && (rwaddr==6'd31))
        voices_31 <= #1 idata;
end

reg [35:0] voices_32;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_32 <= #1 36'b000001110001011000001101111111111111;
    else if(wr && (rwaddr==6'd32))
        voices_32 <= #1 idata;
end

reg [35:0] voices_33;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_33 <= #1 36'b001000010000000000001111100011111000;
    else if(wr && (rwaddr==6'd33))
        voices_33 <= #1 idata;
end

reg [35:0] voices_34;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_34 <= #1 36'b001100010000000000001111011111110111;
    else if(wr && (rwaddr==6'd34))
        voices_34 <= #1 idata;
end

reg [35:0] voices_35;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_35 <= #1 36'b001100100000000000001111011111110111;
    else if(wr && (rwaddr==6'd35))
        voices_35 <= #1 idata;
end

reg [35:0] voices_36;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_36 <= #1 36'b001001010000000000001111100011111000;
    else if(wr && (rwaddr==6'd36))
        voices_36 <= #1 idata;
end

reg [35:0] voices_37;
always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
        voices_37 <= #1 36'b000000010000000000001101110001010101;
    else if(wr && (rwaddr==6'd37))
        voices_37 <= #1 idata;
end

always @(posedge clk or negedge rst_n)begin
    if(!rst_n)
	odata <= #1 36'b0;
    else
	case(rwaddr)
        6'd00  : odata <= #1 voices_00;
        6'd01  : odata <= #1 voices_01;
        6'd02  : odata <= #1 voices_02;
        6'd03  : odata <= #1 voices_03;
        6'd04  : odata <= #1 voices_04;
        6'd05  : odata <= #1 voices_05;
        6'd06  : odata <= #1 voices_06;
        6'd07  : odata <= #1 voices_07;
        6'd08  : odata <= #1 voices_08;
        6'd09  : odata <= #1 voices_09;
        6'd10  : odata <= #1 voices_10;
        6'd11  : odata <= #1 voices_11;
        6'd12  : odata <= #1 voices_12;
        6'd13  : odata <= #1 voices_13;
        6'd14  : odata <= #1 voices_14;
        6'd15  : odata <= #1 voices_15;
        6'd16  : odata <= #1 voices_16;
        6'd17  : odata <= #1 voices_17;
        6'd18  : odata <= #1 voices_18;
        6'd19  : odata <= #1 voices_19;
        6'd20  : odata <= #1 voices_20;
        6'd21  : odata <= #1 voices_21;
        6'd22  : odata <= #1 voices_22;
        6'd23  : odata <= #1 voices_23;
        6'd24  : odata <= #1 voices_24;
        6'd25  : odata <= #1 voices_25;
        6'd26  : odata <= #1 voices_26;
        6'd27  : odata <= #1 voices_27;
        6'd28  : odata <= #1 voices_28;
        6'd29  : odata <= #1 voices_29;
        6'd30  : odata <= #1 voices_30;
        6'd31  : odata <= #1 voices_31;
        6'd32  : odata <= #1 voices_32;
        6'd33  : odata <= #1 voices_33;
        6'd34  : odata <= #1 voices_34;
        6'd35  : odata <= #1 voices_35;
        6'd36  : odata <= #1 voices_36;
        6'd37  : odata <= #1 voices_37;
	default: odata <= #1 36'd0;
        endcase		
end

always @(posedge clk or negedge rst_n)begin
    if(!rst_n)
	rodata <= #1 36'b0;
    else
	case(roaddr)
        6'd00  : rodata <= #1 voices_00;
        6'd01  : rodata <= #1 voices_01;
        6'd02  : rodata <= #1 voices_02;
        6'd03  : rodata <= #1 voices_03;
        6'd04  : rodata <= #1 voices_04;
        6'd05  : rodata <= #1 voices_05;
        6'd06  : rodata <= #1 voices_06;
        6'd07  : rodata <= #1 voices_07;
        6'd08  : rodata <= #1 voices_08;
        6'd09  : rodata <= #1 voices_09;
        6'd10  : rodata <= #1 voices_10;
        6'd11  : rodata <= #1 voices_11;
        6'd12  : rodata <= #1 voices_12;
        6'd13  : rodata <= #1 voices_13;
        6'd14  : rodata <= #1 voices_14;
        6'd15  : rodata <= #1 voices_15;
        6'd16  : rodata <= #1 voices_16;
        6'd17  : rodata <= #1 voices_17;
        6'd18  : rodata <= #1 voices_18;
        6'd19  : rodata <= #1 voices_19;
        6'd20  : rodata <= #1 voices_20;
        6'd21  : rodata <= #1 voices_21;
        6'd22  : rodata <= #1 voices_22;
        6'd23  : rodata <= #1 voices_23;
        6'd24  : rodata <= #1 voices_24;
        6'd25  : rodata <= #1 voices_25;
        6'd26  : rodata <= #1 voices_26;
        6'd27  : rodata <= #1 voices_27;
        6'd28  : rodata <= #1 voices_28;
        6'd29  : rodata <= #1 voices_29;
        6'd30  : rodata <= #1 voices_30;
        6'd31  : rodata <= #1 voices_31;
        6'd32  : rodata <= #1 voices_32;
        6'd33  : rodata <= #1 voices_33;
        6'd34  : rodata <= #1 voices_34;
        6'd35  : rodata <= #1 voices_35;
        6'd36  : rodata <= #1 voices_36;
        6'd37  : rodata <= #1 voices_37;
	default: rodata <= #1 36'b0;
        endcase		
end

endmodule

